import Cookies from 'js-cookie'

const uToken = 'u_token'
const darkMode = 'dark_mode'

//获取Token
export function getToken() {
    return Cookies.get(uToken)
}

//设置Token,1天，与后端同步
export function setToken(token) {
    return Cookies.set(uToken,token,{expires:1})
}

//删除Token
export function removeToken() {
    return Cookies.remove(uToken)
}

export function removeAll() {
    return Cookies.removeAll()
}

//设置暗黑模式
export function setDarkMode(mode) {
    return Cookies.set(darkMode,mode,{expires:365})
}

//获取暗黑模式
export function getDarkMode(mode) {
    return Cookies.get(darkMode)
}